<template>
    <div class="container">

        <description-list v-if="detail!=undefined" title="转单配置基础信息" size="large">
            <description-list-item term="转单名称">{{detail.transformName}}</description-list-item>
            <description-list-item term="产品">{{detail.productSpuName}}</description-list-item>
            <description-list-item term="生效时间">{{detail.effectiveDate}}</description-list-item>
            <description-list-item term="过期时间">{{detail.invalidDate}}</description-list-item>

            <description-list-item term="需转归属地">{{detail.fromBeLocation}}</description-list-item>
            <description-list-item term="转后归属地">{{detail.toBeLocation}}</description-list-item>
            <description-list-item term="状态">{{detail.transformStatus?'启用':'禁用'}}</description-list-item>
            <description-list-item term="描述">{{detail.transformAbout}}</description-list-item>
        </description-list>

        <description-list title="分单数据" size="large">
          待完成
            <!-- <description-list-item term="分单总数">10000单</description-list-item>
            <description-list-item term="分单成功数">8000单</description-list-item>
            <description-list-item term="分单失败">2000单</description-list-item> -->
        </description-list>

        <description-list title="操作记录" size="large">
            待完成
            <!-- <a-table
                :columns="columns"
                :dataSource="data"
                :pagination="{ pageSize: 50 }"
                :scroll="{ y: 200 }"
            /> -->

        </description-list>

    </div>
</template>
<script>
import { DescriptionList } from '@/components'

import { transFormService } from '@/services/index'
const DescriptionListItem = DescriptionList.Item

const columns = [
  {
    title: '订单状态',
    dataIndex: 'status',
    width: 150,
    align: 'center'
  },
  {
    title: '备注',
    dataIndex: 'about',
    width: 150,
    align: 'center'
  },
  {
    title: '操作者',
    dataIndex: 'author',
    align: 'center'
  },
  {
    title: '操作时间',
    dataIndex: 'date',
    align: 'center'
  }
]

const data = []
for (let i = 0; i < 100; i++) {
  data.push({
    key: i,
    status: i % 2 == 0 ? '启用' : '禁用',
    about: 32,
    author: `London, Park Lane no. ${i}`,
    date: `London, Park Lane no. ${i}`
  })
}

export default {
  components: {
    DescriptionList,
    DescriptionListItem
  },
  name: 'configDetail',
  data () {
    return {
      data,
      columns,
      detail: undefined
    }
  },
  methods: {
    loadDetail (id) {
      transFormService.configDetail(id).then(({ isSuccess, data }) => {
        if (isSuccess) {
          this.detail = data
        }
      })
    }
  },
  mounted () {
    const { id } = this.$route.query
    console.log('id:', id);
    this.loadDetail(id)
  }
}
</script>
<style lang="css" scoped>

</style>
